﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 广告发布</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <script type='text/javascript'>
     window.BWEUM || (BWEUM = {}); 
     BWEUM.info = { "stand": true, "agentType": "browser", "agent": "bi-collector.oneapm.com/static/js/bw-send-411.4.5.js", "beaconUrl": "bi-collector.oneapm.com/beacon", "licenseKey": "7VNJE~EViAMmF7MA", "applicationID": 2278177 };</script>
    <script type="text/javascript" src="//bi-collector.oneapm.com/static/js/bw-loader-411.4.5.js"></script>
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <link rel="stylesheet" type="text/css" href="css/MakePublis.css" />
    <style>
        .shared{right: 65px;}
        .centenOff{ width:45px; margin-left:10px; background-color:#ccc; color:#fff}
    </style>
</head>
<body>
    <div class="wamtop">
        <div class="topleft" onclick="window.location.href='Makead_1.html'">
            <img src="img/5.jpg" /></div>
        <div class="topcententxt">
            广告发布</div>
        <div class="topright" onclick="window.location.href='Makead_3.html'">
            <img src="img/16.png" />
        </div>
    </div>
    <div id="waptxt">
        <div class="search">
            <div class="Query">
                <input type="text" class="Stext" id="Stext" placeholder="输入关键词或粘贴文章链接转发" />
                <div class="searchico" id="searchico">
                    <img src="img/Makeimg/10.png" />
                </div>
            </div>
        </div>
        <div id="ws_tg">
        </div>
    </div>
</body>
<script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="js/dialog.js" type="text/javascript"></script>
<script src="js/ajax-data.js" type="text/javascript"></script>
<script src="js/base.js" type="text/javascript"></script>
<script>
    var pagecount = "0";
    var page = 1;
    var keyword = ""; //关键词

    $(document).ready(function () {
        load(page);
        $(window).bind("scroll", function () {
            //当滚动条滚动时
            var scollTop = $(this).scrollTop() + $(this).height();
            var scollH = $(document).height();
            if (scollH - scollTop < 100) {
                if (wait.isShow) { return; } //如果正在加载，则返回
                page++;
                load(page);
            }
            return false;
        });
        $("#searchico").bind("click", search);
    });
    var old = "";
    function load(page) {
        keyword = $("#Stext").val();
        if (old != "" && old == keyword) return;
        if (!islogin()) { window.location.href = 'login.html'; return; }

        AjaxStart("ajax/fc_article.ashx?getlist", "&key_word=" + keyword + "&page_index=" + page, function (data) {
            old = keyword;
            if (data.code == "4") { Alert(data.msg.toString()); pagecount = "1"; return; }
            if (data.item.pageCount < page) {
                if (pagecount == "0")
                    Alert('到底了！');
                pagecount = "1"; return;
            }
            loadhtml(data);
        });
    }
    var date2=new Date();
    function loadhtml(data) {
        $(data.item.table).each(function () {
            var logo = this.logo == null ? "img/30.png" : this.logo;
            var title = this.title;
            if (title.length > 15)
                title = title.substr(0, 15) + "...";
            var css = "centenOff";
            var s2 = "未分享", s3 = "";
            if (this.state == 1) {
                s2 = "分享中";
                css = "centenOn";
                if (this.op_remainder < 1)
                    s2 = "分享完";
            }
            else if (Date.parse(this.date.substr(0, 10)) < date2)
                s2 = "已过期";

            if (this.state == 0 && this.op_total >= 1 && this.op_price >= 1)
                s3 = "<div class=\"centenflow shared\" onclick=\"window.location.href='MakeFX.html?id=" + this.id + "'\">支付</div>";

            $("#ws_tg").append("<div class=\"centenlist\"><a href='fc_detail.aspx?article_id=" + this.id + "'><div class=\"centenimg\"><img src=\"" + logo + "\" /></div></a><div class=\"cententxt\">" +
            "<a href='fc_detail.aspx?article_id=" + this.id + "'><div class=\"cententitlte\">" + title + "</div></a>" +
            "<div class=\"centenTime\">" + this.date.substr(0, 10) + "</div><div class=\"centenShare\">" +
            "<div class=\"" + css + "\">" + s2 + "</div></div>" + s3 + "<div class=\"centenflow\" onclick=\"window.location.href='makeset.html?id=" + this.id + "'\">设置</div></div></div>");
        });
    }

    function search() {
        var url = $("#Stext").val();
        if (url.indexOf('http') == 0) {
            window.location.href = "makeurl_edit.html?url=" + encodeURIComponent(url);
        }
        else {
            $("#ws_tg").html("");
            load(page);
        }
    }
</script>
</html>
